package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.service.MemberOrdersService;
import com.zzyl.serve.domain.NursingProject;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 会员订单项目接口
 *
 * @author qing
 * @date 2025-07-31
 */
@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "会员订单项目接口")
public class MemberOrdersController extends BaseController {
    @Autowired
    private MemberOrdersService memberOrdersService;

    /**
     * 条件分页查询 会员订单项目列表
     */
    @GetMapping("/page")
    public TableDataInfo<List<NursingProject>> page(String name, Integer pageNum, Integer pageSize, Integer status) {
        startPage();
        List<NursingProject> result = memberOrdersService.page(name, pageNum, pageSize, status);
        return getDataTable(result);
    }

    @GetMapping("/{id}")
    public R<NursingProject> getById(@PathVariable Long id) {
        NursingProject nursingProject = memberOrdersService.getById(id);
        return R.ok(nursingProject);
    }
}
